////////////////////////////////////////////////////////////////
// filename: timer.h
// description: keep track of time
// autor: Jay Tomten (jaytomten@gmail.com)
// notes:

// namespace

// defines
#ifndef __TIMER__
#define __TIMER__

// includes

// globals

////////////////////////////////////////////////////////////////
// Timer - class for holding time information
class Timer {

public:

    Timer();  // constructor
    ~Timer(); // destructor

    bool  Update(float d);          // update all the private vars
    float GetDelta();               // return time since last frame
    float GetFPS();                 // return frames per second
    void  LockFPS(float targetFPS); // set a maximum frams per second and hold it

private:

    float fps;       // last calculated FPS value
    int   frame;     // frames since last FPS calculation
    long  currTime;  // current time
    long  prevTime;  // previous time for delta
    long  baseTime;  // base time for fps calc
    float delta;     // time since last frame
    float prevDelta; // the last delta time

};

#endif
